package com.example.combwx.mvp.view.livestreaming;

import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.util.BarUtils;
import com.example.combwx.R;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

public class FullvideoActivity extends AppCompatActivity {
    private static final String TAG = "FullvideoActivity";
    private StandardGSYVideoPlayer full_gsy_player;
    private String url;

    @Override
    protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable
                                    Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_full_video);
        BarUtils.setStatusBarColor(this, Color.WHITE);
        //添加让出状态栏高度->防止contentView布局绘制到状态栏上
        BarUtils.addMarginTopEqualStatusBarHeight(findViewById(R.id.full_video_root));
        url = getIntent().getExtras().getString("live_url");
        Log.e(TAG, "onCreate: "+url);
        full_gsy_player = findViewById(R.id.full_gsy_player);
        full_gsy_player.setUp(url,true,"");
        full_gsy_player.getCurrentPlayer().setAutoFullWithSize(true);
        full_gsy_player.getCurrentPlayer().startWindowFullscreen(this,false,true);
        full_gsy_player.getBackButton().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                full_gsy_player.getGSYVideoManager().stop();
                finish();
            }
        });
        full_gsy_player.startPlayLogic();
    }
}
